package com.xlong.service;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.xlong.BeanEntity.ResponseMsg;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class TaskService {
	
	public ResponseMsg<JSONObject> getResult(JSONObject json){

        log.info(Thread.currentThread().getName() +"--任务开始执行，持续等待中..." + json.toJSONString());
        JSONObject rjson = new JSONObject();
        try {
        	
            Thread.sleep(1000L);
            rjson.put("data", "finished");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info(Thread.currentThread().getName() +"--任务处理完成");
        return new ResponseMsg<JSONObject>(0,"操作成功",rjson);
    }
}
